package com.qf.week1.day04;

import java.util.Scanner;

public class Home1 {
    public static void main(String[] args){

        System.out.println("请输入一个数字:");
        Scanner sc = new Scanner(System.in);
        int number = sc.nextInt();  //输入数字
        int temp = number;          //记录number的值
        int n = 0;                  //反转数字

        while(number!=0){
            int num = number%10;    //获取最后一位
            n = n*10+num;           //将刚获取到的数拼到最右边
            number = number/10;
        }

        if(n == temp){
            System.out.println(n+"是回文数字");
        }else{
            System.out.println(n+"不是回文数字");
        }
    }
}
